<template>
    <div id="app">
        <div class="app-menu">
            <div class="app-menu-item" v-for="route in routes" :key="route.name">
                <router-link :to="route.path">{{ route.name }}</router-link>
            </div>
        </div>
        <div class="app-main">
            <router-view />
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            routes: this.$router.options.routes
        }
    }
}
</script>

<style lang="scss">
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding-left: 200px;
}
div{
    box-sizing: border-box;
}
.app-menu{
    padding: 16px;
    width: 200px;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    &-item{
        padding: 8px;
    }
    a {
        font-weight: bold;
        color: #2c3e50;

        &.router-link-exact-active {
            color: #42b983;
        }
    }
}
.app-main{
    position: absolute;
    padding: 24px;
    right: 0;
    top: 0;
    bottom: 0;
    left: 200px;
}
</style>
